#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

void Find(int arr[], int sz)
{
	int a = 0;
	int b = 0;
	for (b = 0; b < sz; b++)
	{
		a ^= arr[b];
	}
	int flag = 0;
	while ((a >> flag) & 1 == 0)
	{
		flag++;
	}
	int i = 0;
	int ret1 = 0;
	int ret2 = 0;
	for (i = 0; i < sz; i++)
	{
		if ((arr[i] >> flag) & 1 == 1)
		{
			ret1 ^= arr[i];
		}
		else
		{
			ret2 ^= arr[i];
		}
	}
	printf("%d %d", ret1, ret2);
}
int main()
{
	int arr[] = { 1,2,3,4,5,1,2,3,4,6 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Find(arr, sz);
	return 0;
}